<a class="add" href="{$baseUri}admin/system/view-files/?do=viewDirectory" onclick="files.changeDirectory(this, 0); return false;">Přidat fotografie</a>

<script type="text/javascript">

system.initWysiwyg();

</script>

<style type="text/css">
	.picture{
		float: left;
		border: 1px solid grey;
		padding: 2px;
		margin: 1px;
		height: 160px;
	}
	
	.picture span{
		cursor: pointer;
	}
	
	.fileFromSys{
		cursor: pointer;
	}
</style>



<form action="{plink AdminPhotogallery:saveGalleryDetail 'id'=>$id}" method="post">
	<table>
		<tbody>
			
			<tr>
				<td>
					Nadpis:
				</td>
				<td>
					<input type="text" name="title" value="{$edit["title"]}" />
				</td>
			</tr>
			<tr>
				<td>
					Popis:
				</td>
				<td>
					<textarea name="text" class="editor">{$edit["text"]}</textarea>
				</td>
			</tr>
			<tr>
				<td colspan="2">
					<div id="pictures">
						{foreach $edit["pictures"] as $p}
							<div id="pic-{$p["id_photo"]}" class="picture">
								<img src="upload/{$p["path"]}{$p["th_name"]}" />
								<input type="hidden" name="id_files[]" value="{$p["id_file"]}" />
								<span onclick="photogallery.deletePicture({$p["id_photo"]});">&times;</span>
								<br />
								<input type="text" name="files_title[]" value="{$p["title"]}" />
								<input type="radio" name="hlavni" value="{$p["id_file"]}" {if $p["hlavni"]=="1"}checked="checked"{/if} />
							</div>
						{/foreach}
					</div>
				</td>
			</tr>
			<tr>
				<td>
					
				</td>
				<td>
					<input type="submit" value="Uložit" />
				</td>
			</tr>
		</tbody>
	</table>
	
	<input type="hidden" name="id_photogallery" value="{$edit["id_photogallery"]}" />
</form>

<form action="{plink AdminPhotogallery:default 'id'=>$id}" method="POST">
	<input type="submit" value="Zpět" />
</form>



{snippet files}
	{!$files}
{/snippet}